<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>租户--模板管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script src="../js/jquery.min.js" charset="utf-8"></script>
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script src="../js/commonutil.js" charset="utf-8"></script>
    <script src="../js/xadmin.js" type="text/javascript"></script>
    <script src="./function.js" charset="utf-8"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a>
                    <cite>首页</cite>
                </a>
                <a>
                    <cite>模板管理</cite>
                </a>
                <a>
                    <cite>模板管理</cite>
                </a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" id="reloadTemplateData"
       onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5" id="queryTable">
                        <div class="layui-inline">
                            <label class="layui-form-label">模板编号：</label>
                            <div class="layui-inline layui-show-xs-block" style="width: 158px;padding-top: 3px">
                                <input type="text" name="templateNo" id="templateNo" placeholder="模板编号"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">模板名称：</label>
                            <div class="layui-inline layui-show-xs-block" style="width: 158px;padding-top: 3px">
                                <input type="text" id="templateName" name="templateName" lay-verify="title" style="width: 158px" autocomplete="off" placeholder="模板名称" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">签章类型：</label>
                            <div class="layui-inline layui-show-xs-block" style="width: 158px;padding-top: 3px">
                                <select name="sealType" id="sealType">
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">模板状态：</label>
                            <div class="layui-input-inline layui-show-xs-block" style="width: 158px;padding-top: 3px">
                                <select name="templateStatus" id="templateStatus">
                                    <option value="">请选择</option>
                                    <option value="1">启用</option>
                                    <option value="0">停用</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">审核状态：</label>
                            <div class="layui-inline layui-show-xs-block" style="width: 158px;padding-top: 3px">
                                <select name="auditStatus" id="auditStatus">
                                </select>
                            </div>
                        </div>
                        <br/>
                        <div class="layui-inline">
                            <label class="layui-form-label">开始时间：</label>
                            <div class="layui-inline layui-show-xs-block" style="width: 158px;padding-top: 3px">
                                <input class="layui-input" autocomplete="off" placeholder="开始时间" name="createTime"
                                       id="createTime">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">结束时间：</label>
                            <div class="layui-inline layui-show-xs-block" style="width: 158px;padding-top: 3px">
                                <input class="layui-input" autocomplete="off" placeholder="结束时间" name="updateTime"
                                       id="updateTime">
                            </div>
                        </div>
                        <div class="layui-inline layui-show-xs-block" style="padding-left: 35px;">
                            <div class="layui-btn" data-type="query" id="submitBtn"><i class="layui-icon">&#xe615;</i>查询
                            </div>
                            <div class="layui-btn" data-type="reset" id="resetBtn"><i class="layui-icon">&#xe631;</i>重置
                            </div>
                        </div>
                    </form>
                </div>
                <div class="layui-card-body ">
                    <!-- 数据表格部分-->
                    <table class="layui-table" id="searchTable" lay-filter="searchTable"></table>
                </div>
                <!-- 分页部分-->
                <div id="tablePage" style="padding-left: 18px"></div>
            </div>
        </div>
    </div>
</div>
</body>

<!--表格头部-->
<script type="text/html" id="tableToolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="create"> 新增模板</button>
        <button class="layui-btn layui-btn-sm" lay-event="createAudit"> 配置审批流</button>
        <button class="layui-btn layui-btn-sm" lay-event="export">批量下载</button>
    </div>
</script>
<!--表格右侧工具栏-->
<script type="text/html" id="barSearch">
    <div class="layui-btn-container">
        <button class="layui-btn" lay-event="preview">预览</button>
        <button class="layui-btn" lay-event="update">修改</button>
        {{# if(d.templateStatus === 2 || d.auditStatus != 2){ }}
        <button class="layui-btn layui-btn-disabled" disabled lay-event="updateStatus">启停</button>
        {{# } else{ }}
        <button class="layui-btn" lay-event="updateStatus">启停</button>
        {{# } }}
        <button class="layui-btn" lay-event="download">下载</button>
    </div>
</script>
<script>
    jQuery(function () {
        layui.use(['laypage', 'jquery', 'layer', 'table', 'form', 'util'], function () {
            let form = layui.form;
            //初始化日期
            initDate();
            //初始化签章类型
            querySealType(form);
            //初始化审核状态
            queryAuditStatus(form);
        });

        $("#updateStatus").addClass("layui-btn layui-btn-radius layui-btn-disabled").prop("disabled", true);

        let requestUrl = serverPre + "/manager/scs/v2/template/list";
        //开启默认查询
        submit(requestUrl);
    });

    //查询数据
    $('#submitBtn').click(function () {
        let requestUrl = serverPre + "/manager/scs/v2/template/list";
        submit(requestUrl);
    });
    //清空条件
    $('#resetBtn').click(function () {
        document.getElementById("queryTable").reset();
    });
</script>
</html>
